package pers.ascend.spring.cloud.dalston.config.center.center.eureka.config.client.manage.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 说明：
 *
 * @author ascend
 * 2021/3/18 15:19
 */
@RestController
@RequestMapping(path = "/eureka/config/client")
@Validated
@RefreshScope
public class EurekaConfigClientController {
    protected Logger log = LoggerFactory.getLogger(getClass());

    @Value("${info.profile}")
    private String profile;

    @GetMapping(path = "/profile")
    public String profile() {
        if (log.isInfoEnabled()) {
            log.info("EurekaConfigClientController.profile()");
        }
        return profile;
    }
}
